1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gio.PowerProfileMonitorT; 26 27 public import gio.PowerProfileMonitorIF; 28 public import gio.c.functions; 29 public import gio.c.types; 30 public import gobject.ObjectG; 31 32 33 /** 34 * #GPowerProfileMonitor makes it possible for applications as well as OS components 35 * to monitor system power profiles and act upon them. It currently only exports 36 * whether the system is in “Power Saver” mode (known as “Low Power” mode on 37 * some systems). 38 * 39 * When in “Low Power” mode, it is recommended that applications: 40 * - disabling automatic downloads 41 * - reduce the rate of refresh from online sources such as calendar or 42 * email synchronisation 43 * - if the application has expensive visual effects, reduce them 44 * 45 * It is also likely that OS components providing services to applications will 46 * lower their own background activity, for the sake of the system. 47 * 48 * There are a variety of tools that exist for power consumption analysis, but those 49 * usually depend on the OS and hardware used. On Linux, one could use `upower` to 50 * monitor the battery discharge rate, `powertop` to check on the background activity 51 * or activity at all), `sysprof` to inspect CPU usage, and `intel_gpu_time` to 52 * profile GPU usage. 53 * 54 * Don't forget to disconnect the #GPowerProfileMonitor::notify::power-saver-enabled 55 * signal, and unref the #GPowerProfileMonitor itself when exiting. 56 * 57 * Since: 2.70 58 */ 59 public template PowerProfileMonitorT(TStruct) 60 { 61 /** Get the main Gtk struct */ 62 public GPowerProfileMonitor* getPowerProfileMonitorStruct(bool transferOwnership = false) 63 { 64 if (transferOwnership) 65 ownedRef = false; 66 return cast(GPowerProfileMonitor*)getStruct(); 67 } 68 69 70 /** 71 * Gets whether the system is in “Power Saver” mode. 72 * 73 * You are expected to listen to the 74 * #GPowerProfileMonitor::notify::power-saver-enabled signal to know when the profile has 75 * changed. 76 * 77 * Returns: Whether the system is in “Power Saver” mode. 78 * 79 * Since: 2.70 80 */ 81 public bool getPowerSaverEnabled() 82 { 83 return g_power_profile_monitor_get_power_saver_enabled(getPowerProfileMonitorStruct()) != 0; 84 } 85 }